
[dbo].[fn_asi_SoftCreditCMDM_Amount]
CREATE FUNCTION fn_asi_SoftCreditCMDM_Amount
(@pTransNumber int,
@pOrignatingActivitySeqn int,
@pSoftCreditId as varchar(50))
RETURNS money
AS
BEGIN
declare @correctionVal money
select
@correctionVal = sum(AMOUNT)
from
Trans_SoftCredit
where
ORIGINATING_ACTIVITY_SEQN = @pOrignatingActivitySeqn
and TRANS_NUMBER <> @pTransNumber
and SOFT_CREDIT_ID=@pSoftCreditId
return isnull(@correctionVal,0)
END
GO
GRANT EXECUTE ON [dbo].[fn_asi_SoftCreditCMDM_Amount] TO [IMIS]
GO